<!DOCTYPE html>
<html lang="en">
<style>
    *{
        margin: 0;
        padding: 0;
    }
    body {
        display: flex;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
    }
    button {
        outline: none;
        border: none;
        cursor: pointer;
    }
    .btn {
        position:relative;
        height: 40px;
        padding: 0 15px;
        color: #fff;
        font-size: 16px;
        border-width: 1px;
        border-style: solid;
        border-radius: 3px;
        margin: 0 10px;
    }
    .btn-primary {
        background-color: #54a0ff;
        border-color: #2e86de;
    }
    .btn-secondary {
        background-color: #48dbfb;
        border-color: #0abde3;
    }
    .btn-warning {
        background-color: #feca57;
        border-color: #ff9f43;
    }
    .btn-success {
        background-color: #1dd1a1;
        border-color: #10ac84;
    }

    .mask {
        position: absolute;
        display: block;
        width: 100%;
        height: 100%;
        background-color: #fff;
        opacity: 0;
    }
    .mask-1 {
        top: 0;
        left: 0;
    }
    .mask-2 {
        top: 0;
        left: 0;
        border-top-right-radius: 40px;
    }
    .mask-3 {
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
    }
    .mask-4 {
       width: 100%;
       height: 0;
       left:0;
       bottom:0;
    }
    .btn-primary:hover .mask {
        animation-name: btn-animation-one;
        animation-duration: 1s;
    }

    @keyframes btn-animation-one {
        from {
            width: 0;
            opacity: 1;
        }
        to {
            width: 100%;
            opacity: 0;
        }
    }
    .btn-secondary:hover .mask {
        animation-name: btn-animation-one;
        animation-duration: 1s;
    }

    .btn-warning:hover .mask {
        animation-name: btn-animation-two;
        animation-duration: 1s;
    }

    @keyframes btn-animation-two {
        from {
            width: 1px;
            height: 1px;
            transform: scale(0);
            opacity: 1;
        }
        to {
            width: 1px;
            height: 1px;
            transform: scale(100);
            opacity: 0;
        }
    }

    .btn-success:hover .mask {
        animation-name: btn-animation-three;
        animation-duration: 1s;
    }

    @keyframes btn-animation-three {
        from {
            height: 0px;
            opacity: 1;
        }
        to {
            height: 100%;
            opacity: 0;
        }
    }
</style>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="btn-wrapper">
        <button class="btn btn-primary">按钮1<span class="mask mask-1"></span></button>
        <button class="btn btn-secondary">按钮2<span class="mask mask-2"></span></button>
        <button class="btn btn-warning">按钮3<span class="mask mask-3"></span></button>
        <button class="btn btn-success">按钮4<span class="mask mask-4"></span></button>
    </div>
</body>
</html>